home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-1.iso
/
games
/
dcgames4.zip
/
DESCOBJ.SCR
< prev
next >
Wrap
Text File
|
1995-10-02
|
6KB
|
165 lines
!
! Script Name: DESCOBJ.SCR
!
! This script can be called from any other script to describe a given
! object. The object is identified by the OBJECT variable which must
! point to an existing object (not being carried by anyone).
!
! To look at an item being carried by someone, you should call the
! CURRITEM script which performs the same function on the 'curritem'
! variable.
!
! Example:
! curritem = player.weapon;
! runscript( curritem.script, "CURRITEM", EXAMINE );
!
!------------------------------------------------------------------------!
! :@TALK ! No talking in this script..
!------------------------------------------------------------------------!
! :@GET ! No getting in this script
!------------------------------------------------------------------------!
! :@DROP ! No droping in this script
!------------------------------------------------------------------------!
! :@WEAR ! No wearing or wielding stuff
!------------------------------------------------------------------------!
! :@REMOVE ! No removing either..
!------------------------------------------------------------------------!
!------------------------------------------------------------------------!
:@LOOK ! Finally something we can do!!!!
!------------------------------------------------------------------------!
L(255) = FALSE; ! Set a flag so the subroutine does not give a
! full description (i.e. LOOK, not EXAMINE)
gosub DESCRIBE;
STOP;
!------------------------------------------------------------------------!
:@EXAMINE ! Examine the object in detail !
!------------------------------------------------------------------------!
L(255) = TRUE; ! Give DETAILED description !
gosub DESCRIBE;
STOP;
!------------------------------------------------------------------------!
!
! SUBROUTINE: DESCRIBE
!
! This routine is invoked from @LOOK, @EXAMINE
!
!------------------------------------------------------------------------!
:DESCRIBE
!------------------------------------------------------------------------!
if object.count = 0 then
writeln( "DBG: Opps. There is nothing to look at in DESCOBJ.SCR" );
STOP;
endif;
if object.picture >= 0 then
viewpcx( object );
if success then
pause;
endif;
paint(window); ! Assumes the picture fits in the window !
elsif object.type = SIGN or object.type = BOOK then
readtext( object.text );
STOP;
endif;
write( "You see a ", object.name );
if NOT L(255) then
writeln;
STOP;
endif;
write( ", Type: ", object.type );
!
! The following is a 'cascading if..then..elsif..elsif.....else..endif'
! statement. It is used here to illustrate it's usefulness. The same
! code could have been written with a 'ON object.type GOTO' statement.
!
if object.type = FOOD or object.type = POTION then
if object.class then
write( ", Class: ", object.class );
if object.class <> CURE then
write( ", Units: ", object.units );
endif;
endif;
elsif object.type = WEAPON then
write( ", Class: ", object.class,
", Hands: ", object.hands,
", Range: ", object.range,
", Damage: ", object.damage );
if object.ammoneeded then
write( ", Needs ammo type: ", object.ammo_type );
endif;
elsif object.type = AMMO then
write( ", Ammo Type: ", object.ammotype );
if object.traptype then
write( ", Poisoned" );
endif;
if object.damage then
write( ", Extra Damage: ", object.damage );
endif;
elsif object.type = ARMOR or object.type = SHIELD then
write( ", Armor Class: ", object.ac );
if object.cursed then
write( " Cursed!" );
endif;
elsif object.type = AMULET or object.type = RING or object.type = GEMS then
if object.class then
write( ", Class: ", object.class );
write( ", Charges: ", object.charges );
if object.class <> CURE then
write( ", Units: ", object.units );
if object.permanent then
write( ", Permanent!" );
else
write( ", Temporary" );
endif;
endif;
if object.cursed then
write( ", Cursed!" );
endif;
endif;
elsif object.type = SCROLL then
write( ", Class: ", object.class );
elsif object.type = STAFF then
write( ", Class: ", object.class, ", Charges: ", object.charges );
elsif object.type = CHEST then
if object.locktype then
write( ", Locked!" );
if object.traptype = 0 then
write( ", no traps" );
elsif object.traptype = 1 then
write( ", poison trap" );
else
write( ", bomb damage: ", object.traptype );
endif;
endif;
! elsif object.type = KEYS then
! nothing special about it
! elsif object.type = BOOK then
! nothing special about it
! elsif object.type = GOLDSACK then
! nothing special about it
! elsif object.type = TORCH then
! nothing special about it
! elsif object.type = LANTERN then
! nothing special about it
! elsif object.type = ROPE then
! nothing special about it
! elsif object.type = HOOKS then
! nothing special about it
! elsif object.type = MIRROR then
! nothing special about it
! elsif object.type = SIGN then
! nothing special about it
elsif object.type = VEHICLE then
write( ", Class: ", object.class );
! else
! user defined type?
endif;
if object.weight > 1 and object.weight < 256 then
write( ", Weight: ", object.weight );
endif;
writeln( "." );
return;